package com.wanmait.employment.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.wanmait.employment.entity.NatureWork;
import com.wanmait.employment.mapper.NatureWorkMapper;
import com.wanmait.employment.service.NatureWorkService;
import com.wanmait.employment.util.AjaxResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
@Service
public class NatureWorkServiceImpl implements NatureWorkService {

    @Resource
    private NatureWorkMapper natureWorkMapper;

    @Override
    public List<NatureWork> findAll(String title) {
        QueryWrapper<NatureWork>queryWrapper=new QueryWrapper<>();
        queryWrapper.like("title",title);
        return natureWorkMapper.selectList(queryWrapper);
    }

    @Override
    public Integer  insert(NatureWork natureWork) {
       return natureWorkMapper.insert(natureWork);

    }

    @Override
    public Integer update(NatureWork natureWork) {
        return natureWorkMapper.updateById(natureWork);
    }

    @Override
    public Integer delete(Integer id) {
        return natureWorkMapper.deleteById(id);
    }
}
